# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=charls
pkgver=2.1.0
pkgrel=1
pkgdesc="An optimized implementation of the JPEG-LS standard for lossless and near-lossless image compression"
url="https://github.com/team-charls/charls"
arch="all"
license="BSD-3-Clause"
makedepends="
	cmake
	"
subpackages="
	$pkgname-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/team-charls/charls/archive/$pkgver.tar.gz"

build() {
	cmake . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

check() {
	# The testprogram requires "Press any key + 'enter' to exit program"
	echo "end\n" | ./test/charlstest -unittest
}
sha512sums="456539243d984ebe6afe1bbb7c9422e642cf0346d25d220126ad8a6d04e945c6c340ab3c2b73a7db4ec390ed6a52236e5c6e9ad6d14e8b78b701937810fb327d  charls-2.1.0.tar.gz"
